#include "client.h"
#include <QDebug>
#include <QTimer>
Client::Client()
{
    tcpSocket = new QTcpSocket();
    connectToHost();


}

void Client::sendMsg(QString command)
{
    tcpSocket->write(command.toUtf8());
}

void Client::connectToHost()
{
    serverIp.setAddress("127.0.0.1");
    serverPort = 8080;
    tcpSocket->connectToHost(serverIp, serverPort);
}

void Client::onConnected()
{
    qDebug() << "客户端连接到服务器";
}

void Client::disConnect()
{
    tcpSocket->disconnectFromHost();
}
